// @ts-ignore
import { api } from '@/utils/api';

/** 获取用户信息get请求 GET /openApi/getUserInfoGet */
export async function openApiGetUserInfoGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: BASE.openApiGetUserInfoGetParams,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResultGetUserInfoResponse>;

export async function openApiGetUserInfoGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: BASE.openApiGetUserInfoGetParams,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResultGetUserInfoResponse>>;

export async function openApiGetUserInfoGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: BASE.openApiGetUserInfoGetParams,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResultGetUserInfoResponse>;

export async function openApiGetUserInfoGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: BASE.openApiGetUserInfoGetParams,
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResultGetUserInfoResponse>(`/app/openApi/getUserInfoGet`, {
      method: 'GET',
      params: {
        ...params,
        request: undefined,
        ...params['request']
      },
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResultGetUserInfoResponse>(`/app/openApi/getUserInfoGet`, {
    method: 'GET',
    params: {
      ...params,
      request: undefined,
      ...params['request']
    },
    ...(options || {})
  });
}

/** 获取用户信息post请求 POST /openApi/getUserInfoPost */
export async function openApiGetUserInfoPost(
  body: BASE.GetUserInfoRequest,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResultGetUserInfoResponse>;

export async function openApiGetUserInfoPost(
  body: BASE.GetUserInfoRequest,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResultGetUserInfoResponse>>;

export async function openApiGetUserInfoPost(
  body: BASE.GetUserInfoRequest,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResultGetUserInfoResponse>;

export async function openApiGetUserInfoPost(
  body: BASE.GetUserInfoRequest,
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResultGetUserInfoResponse>(`/app/openApi/getUserInfoPost`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResultGetUserInfoResponse>(`/app/openApi/getUserInfoPost`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}
